<template>
    <div class="loginBox">
        <div class="loginTitle">
            <p>账号密码登录</p>
            <div></div>
        </div>
        <input class="text" type="text" placeholder="请输入账号" v-model="form.name">
        <input class="password" type="password" placeholder="请输入密码" v-model="form.password">
        <p class="noPassword">忘记密码</p>
        <button class="btn" @click="login">登录</button>
    </div>
</template>


<script>
import { ElButton, ElForm, ElMessage } from "element-plus";
import { httpService } from "@/utils/httpService";

export default {
    name: "LoginRegister",
    created() { },
    mounted() { },
    components: { ElButton, ElForm, ElMessage },
    data() {
        return {
            isShow: true,
            showQrCode: true,
            path: "wss://wx.zhengzhong.cn/javaApi/websocket/",
            socket: "",
            state: "",
            form: {
                name: "",
                password: "",
            },
        };
    },
    methods: {

        login() {
            let params = new FormData();
            params.append("name", this.form.name);
            params.append("password", this.form.password);
            httpService("/javaApi/login", params, "post").then((data) => {
                if (data.code == 200) {
                    sessionStorage.removeItem("token");
                    sessionStorage.removeItem("user");
                    sessionStorage.setItem("token", data.object.token);
                    sessionStorage.setItem("user", JSON.stringify(data.object.data));

                    this.$router.replace("medicalProductLogin");

                } else {
                    ElMessage.error(data.message);
                }
            });
        },
    },
};
</script>
<style scoped>
* {
    padding: 0;
    margin: 0;
}

.flex {
    display: flex;
    align-items: center;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
}

.left {
    width: 49vw;
    height: 100vh;
    background-color: #EEF7FB;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.left_title {
    color: #000;
    font-size: 30px;
    font-weight: bold;
    margin-top: -64px;
}

.left_content {
    color: #999999;
    font-size: 16px;
    margin-top: 37px;
}

.left img {
    width: 75%;
    margin-top: 26px;
}

.right {
    width: 51vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 172px;
}



.right_title {
    margin-left: 36px;
    margin-top: -40px;
}

.right_title .span1 {
    font-size: 25px;
    color: #000;
    font-weight: bold;
}

.right_title .span2 {
    font-size: 18px;
    color: #999999;
    margin-left: 15px;
}

.loginBox {
    width: 460px;
    height: 453px;
    /* width: 388px;
    height: 343px; */
    padding: 41px 36px 65px;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    box-sizing: border-box;
    margin-top: 29px;
}

.loginTitle {
    color: #000;
    font-size: 18px;
    font-weight: bold;

}

.loginTitle div {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: #6F72FF;
    width: 107px;
    margin-top: 7px;
}

input {
    width: calc(100% - 18px);
    height: 58px;
    border: none;
    outline: none;
    background-color: #EFEFEF;
    border-radius: 10px;
    margin-top: 35px;
    font-size: 14px;
    color: #000;
    padding-left: 18px;
}

input::placeholder {
    color: #999999;
}

.noPassword {
    color: #6F72FF;
    margin: 10px 0 0 18px;
    font-size: 14px;
}

.btn {
    width: 100%;
    height: 58px;
    background-color: #6F72FF;
    color: #fff;
    font-size: 20px;
    border: none;
    border-radius: 29px;
    margin-top: 49px;
}







</style>